package com.york.model.dto.excel;

import lombok.Data;

@Data
public class ExcelSelectedResolve {
    /**
     * 下拉内容
     */
    private String[] source;

    /**
     * 设置下拉框的起始行，默认为第二行
     */
    private int firstRow;

    /**
     * 设置下拉框的结束行，默认为最后一行
     */
    private int lastRow;
    public String[] resolveSelectedSource(ExcelSelected excelSelected, String[] dynamicSelect) {
        if (excelSelected == null) {
            return null;
        }
        if(dynamicSelect != null) {
        	return dynamicSelect;
        }
        // 获取固定下拉框的内容
        String[] source = excelSelected.source();
        if (source.length > 0) {
            return source;
        }
        return null;
    }
}
